﻿using ConfExpert.Forms.Base;
using DevExpress.Utils;
using DevTeam;
using System;
using System.Drawing;

namespace ConfExpert.Forms.Depo.Westbrook
{
    public partial class Tuketim : XForm
    {
        string idx;
        public Tuketim(string _idx)
        {
            InitializeComponent();
            idx = _idx;
        }

        private void Tuketim_Load(object sender, EventArgs e)
        {

            gridView1.Init("GetWestbrookTuketim", idx);
            gridView1.AddDetailGrid(gridView2, "ProductId");

            gridView1.Columns["NetQty"].Caption = "AvailQty";
            gridView1.AddSummary("QtyDepo", "QtyNeeded");
            gridView2.AddSummary("Adet", "QtyNeeded");
            gridView1.RowCellStyle += new DevExpress.XtraGrid.Views.Grid.RowCellStyleEventHandler(gridView1_RowCellStyle);

            gridView1.UpdateTotalSummary();
            gridView1.BestFitColumns();
            gridView2.BestFitColumns();
        }

        void gridView1_RowCellStyle(object sender, DevExpress.XtraGrid.Views.Grid.RowCellStyleEventArgs e)
        {
            if (e.Column.FieldName == "Durum")
                e.Appearance.Font = new Font(AppearanceObject.DefaultFont, FontStyle.Bold);
        }

    }
}